#include"TcpEchoServer.hpp"
#include<memory>

void Usage(std::string proc)
{
    std::cout << "Usage: " <<proc << " serverport" <<std::endl;
}

//./server serverport
int main(int argc , char* argv[])
{
    if(argc != 2)
    {
        Usage("argv[0]");
        return 0;
    }

    EnableConsoleLogStrategy();

    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<TcpEchoServer> tes = std::make_unique<TcpEchoServer>(port);
    tes->Init();
    tes->Start();

    return 0;
}